/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package generatorGraphics.graphics;

import grammaticalClasses.nwConsole.ShowStatCur;
import grammaticalClasses.nwConsole.ShowStatDay;
import grammaticalClasses.nwConsole.ShowStatShort;
import java.awt.Color;
import java.awt.Dimension;
import java.util.ArrayList;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import org.jfree.data.general.SeriesException;
import org.jfree.data.time.Minute;
import org.jfree.data.time.TimeSeries;

/**
 *
 * @author Heitor
 */
public class Stability extends Graph {
    
    public Stability(){
        name = "Stability";
        help = "Help of Stability";
        
        configUnitOptions();
        
        commands.add("ShowStatNet");
        commands.add("ShowStatDay");
        commands.add("ShowStatShort");
    }

    private void configUnitOptions() {
        
        unitList.add("Time per Day");
        unitList.add("Time 15 to 15");
    }
    
    @Override
    protected void createGraph(String unit){
        
        int indice;
        
        switch (unit){
            case "Time per Day":
                indice = search.getAnswer(commands, "ShowStatDay");

                chartPanel = new ChartPanel(buildGraphTDay((ArrayList<ShowStatDay>) answer.get(indice)));
                chartPanel.setBackground(Color.LIGHT_GRAY);
                chartPanel.setPreferredSize(new Dimension(700, 350)); 
                chartPanel.setDomainZoomable(false);
                chartPanel.setRangeZoomable(false);
                break;
            case "Time 15 to 15":
                indice = search.getAnswer(commands, "ShowStatShort");
                
                chartPanel = new ChartPanel(buildGraphT15to15((ArrayList<ShowStatShort>) answer.get(indice)));
                chartPanel.setBackground(Color.LIGHT_GRAY);
                chartPanel.setPreferredSize(new Dimension(700, 350)); 
                chartPanel.setDomainZoomable(false);
                chartPanel.setRangeZoomable(false);
                break;
            default:
                chartPanel = new ChartPanel(null);
                break;
        }
    }

    private JFreeChart buildGraphTDay(ArrayList<ShowStatDay> arrayList) {
        throw new UnsupportedOperationException("Not yet implemented");
    }

    private JFreeChart buildGraphT15to15(ArrayList<ShowStatShort> auxStatShort) {
        throw new UnsupportedOperationException("Not yet implemented");
    }
    
}
